clear
clear matrix
set maxvar 10000

log using "C:\Users\Madhav Joshi\Box\2020 Research\SSR Reviews\SSR Data\2020-12-28 log.smcl", replace
use "C:\Users\Madhav Joshi\Box\2020 Research\SSR Reviews\SSR Data\SSR Data.dta", clear

//Table 1 in MS

xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_gdpgr L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
test L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA   
xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
test L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA   
xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
test L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA   
//PAM as a dummy variable
xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
test L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA 

// Table 2 Alternative dependent variable V-DEM

xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_gdpgr L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
test L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA   
xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
test L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA   
xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
test L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA   
//PAM as a dummy variable 
xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
test L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA   


//Margins plot CIRI
xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

margins, predict(outcome(0)) at(L.outcome_GovtVic ==0 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.agg_imp_rate1 ==(0(10)100)) atmeans
marginsplot
//quietly marginsplot
//graph save Graph "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\outcome0.gph", replace


margins, predict(outcome(1)) at(L.outcome_GovtVic ==0 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.agg_imp_rate1 ==(0(10)100)) atmeans
marginsplot
//quietly marginsplot
//graph save Graph "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\outcome1.gph", replace


margins, predict(outcome(2)) at(L.outcome_GovtVic ==0 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.agg_imp_rate1 ==(0(10)100)) atmeans
marginsplot
//quietly marginsplot
//graph save Graph "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\outcome2.gph", replace

margins, predict(outcome(3)) at(L.outcome_GovtVic ==0 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.agg_imp_rate1 ==(0(10)100)) atmeans
marginsplot
//quietly marginsplot
//graph save Graph "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\outcome3.gph", replace

//graph combine "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\outcome0.gph" "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\outcome1.gph" "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\outcome2.gph" "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\outcome3.gph", ycommon

//Marginsplot after v-dem
xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
margins, at(L.outcome_GovtVic ==0 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.agg_imp_rate1 ==(0(10)100)) atmeans
marginsplot

//Margins after CPA dummy V-dem
xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
margins, at(L.outcome_GovtVic ==0 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.inpam1==1) atmeans
margins, at(L.outcome_GovtVic ==0 L.nonCPA_PA ==1 L.outcome_RebelVic ==0 L.inpam1==0) atmeans
margins, at(L.outcome_GovtVic ==0 L.nonCPA_PA ==0 L.outcome_RebelVic ==1 L.inpam1==0) atmeans
margins, at(L.outcome_GovtVic ==1 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.inpam1==0) atmeans


//Margins after CIRI
xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
margins, at(L.outcome_GovtVic ==0 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.inpam1==1) atmeans
margins, at(L.outcome_GovtVic ==0 L.nonCPA_PA ==1 L.outcome_RebelVic ==0 L.inpam1==0) atmeans
margins, at(L.outcome_GovtVic ==0 L.nonCPA_PA ==0 L.outcome_RebelVic ==1 L.inpam1==0) atmeans
margins, at(L.outcome_GovtVic ==1 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.inpam1==0) atmeans




//Appendixes
//Table 1 Descriptive Statistics
 sum ciri_wopol ciri_wopol_yrbefter_rev v2x_gender vdem_womemp_yrbefter coldcase outcome_RebelVic outcome_GovtVic  inpam agg_imp_rate1  nonCPA_PA cum_peace_year   wdi_gdpgr govonlyv413m ln_total_dead ln_wardur lnpkoave_total  wdi_natrr ex_constrain5_7 women_imp post_2000 sumconfv413 if year>1988 & year<2012 & mj_conflictid!=. 

//Table 2 results from unrevised CIRI
xtologit ciri_wopol ciri_wopol_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_gdpgr L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol ciri_wopol_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol ciri_wopol_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol ciri_wopol_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)



//CPA histogram
hist agg_imp_rate1 if inpam==1 & year>1988 & mj_conflictid!=., normal
//CIRI histogram
histogram ciri_wopol if year>1988 & mj_conflictid!=., discrete normal

//VDEM Histogram
histogram v2x_gender_codehigh if year>1988 & mj_conflictid!=., normal
histogram v2x_gender_codelow if year>1988 & mj_conflictid!=., normal
histogram v2x_gender if year>1988 & mj_conflictid!=., normal

//Data for Figure 1
count if inpam1!=1 & coldcase!=1 & nonCPA_PA!=1 & outcome_GovtVic!=1 & outcome_RebelVic==1 & year>1988 & year<2012 & mj_conflictid!=.
count if inpam1!=1 & coldcase!=1 & nonCPA_PA!=1 & outcome_GovtVic==1 & outcome_RebelVic!=1 & year>1988 & year<2012 & mj_conflictid!=.
count if inpam1!=1 & coldcase!=1 & nonCPA_PA==1 & outcome_GovtVic!=1 & outcome_RebelVic!=1 & year>1988 & year<2012 & mj_conflictid!=.
count if inpam1!=1 & coldcase==1 & nonCPA_PA!=1 & outcome_GovtVic!=1 & outcome_RebelVic!=1 & year>1988 & year<2012 & mj_conflictid!=.
count if inpam1==1 & coldcase!=1 & nonCPA_PA!=1 & outcome_GovtVic!=1 & outcome_RebelVic!=1 & year>1988 & year<2012 & mj_conflictid!=.

//Figure 1
clear
use "C:\Users\Madhav Joshi\Box\2020 Research\SSR Reviews\Bar graph data.dta", replace
graph hbar freq, over(term_type, sort(1) descending)blabel(bar)

//Figure 3 

clear
use  "C:\Users\Madhav Joshi\Box\2020 Research\SSR Reviews\Data for v-dem margin.dta", clear
serrbar margin stderr  var6,  xlabel( 4 "CPA " 3 "Non-CPA " 2 "Govt. victory " 1 "Rebel victory", noticks)

log close



















//Other CIRI Measures

xtologit ciri_wecon ciri_weco_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wosoc ciri_wsoc_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

//xtgee
xtgee ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, i(ccode) t(year) family(gaussian) corr(ar1) vce(robust)
xtgee v2x_gender_codelow L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, i(ccode) t(year) family(gaussian) corr(ar1) vce(robust)

//rotate the reference category and replicate Model 3
xtologit ciri_wopol ciri_wopol_yrbefter_rev L.coldcase L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.coldcase L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.coldcase L.agg_imp_rate1 L.outcome_GovtVic  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)


//Data for Figure 1
count if inpam1!=1 & coldcase!=1 & nonCPA_PA!=1 & outcome_GovtVic!=1 & outcome_RebelVic==1 & year>1988 & year<2012 & mj_conflictid!=.
count if inpam1!=1 & coldcase!=1 & nonCPA_PA!=1 & outcome_GovtVic==1 & outcome_RebelVic!=1 & year>1988 & year<2012 & mj_conflictid!=.
count if inpam1!=1 & coldcase!=1 & nonCPA_PA==1 & outcome_GovtVic!=1 & outcome_RebelVic!=1 & year>1988 & year<2012 & mj_conflictid!=.
count if inpam1!=1 & coldcase==1 & nonCPA_PA!=1 & outcome_GovtVic!=1 & outcome_RebelVic!=1 & year>1988 & year<2012 & mj_conflictid!=.
count if inpam1==1 & coldcase!=1 & nonCPA_PA!=1 & outcome_GovtVic!=1 & outcome_RebelVic!=1 & year>1988 & year<2012 & mj_conflictid!=.

log close

//Use the data for plot
clear
use "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Data for v-dem margin.dta"
serrbar margin stderr  var6,  xlabel( 4 "CPA " 3 "Non-CPA " 2 "Govt. victory " 1 "Rebel victory", noticks)



//Log End



//Table 1 in MS

eststo: quietly xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_gdpgr L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

esttab using "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\Table1.rtf", b(a3) nogaps title (Table1: Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear

// Table 2 Alternative dependent variable V-DEM

eststo: quietly xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_gdpgr L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
eststo: quietly xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
eststo: quietly xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
eststo: quietly xtreg v2x_gender_codelow vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, fe vce(robust)
esttab using "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\Table2.rtf", b(a3) nogaps title (Table2: Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear

//Appendix
//Table 1 descriptive stat
//Table 2 results from unrevised CIRI
eststo: quietly xtologit ciri_wopol ciri_wopol_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_gdpgr L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wopol ciri_wopol_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wopol ciri_wopol_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
esttab using "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\App_Table2.rtf", b(a3) nogaps title (Appendix Table2: Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear

//Appendix Table 3 xtgee
eststo: quietly xtgee ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, i(ccode) t(year) family(gaussian) corr(ar1) vce(robust)
eststo: quietly xtgee v2x_gender_codelow L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, i(ccode) t(year) family(gaussian) corr(ar1) vce(robust)
esttab using "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\App_Table3.rtf", b(a3) nogaps title (Appendix Table4: Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear

//Table 4 Other CIRI Measures

eststo: quietly xtologit ciri_wecon ciri_weco_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wosoc ciri_wsoc_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
esttab using "C:\Users\mjoshi2\Box\2020 Research\SSR Reviews\Revisions\App_Table4.rtf", b(a3) nogaps title (Appendix Table4: Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear

//rotate the ref category







///Keeping data
edit year COWcode cname leader yrdied yrborn eindate year_in  office_entry_age age_70 lag_v2xps_party lag_p_polity2 lag_lnCNTS_TerrGuerWarfare  ////
lag_wdi_gdpgr regular_entry fem_leader lag_wdi_popgr lag_wdi_pop1564 lag_wdi_pop65  post_coldwar africa asia ocenia north_america ///
south_america year_1946_55 year_1956_65 year_1966_75 year_1976_85 year_1986_95 year_1996_05 lag_p_polity2 year_2006_15 if _merge==3


xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

nlcom _b[ L.agg_imp_rate1]*60 + _b[ciri_wopol_yrbefter_rev]*0 + _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*0 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m]*0 +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000] +_b[L.sumconfv413] 
nlcom _b[ L.agg_imp_rate1]*60 + _b[ciri_wopol_yrbefter_rev]*1 + _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*0 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m]*0 +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000] +_b[L.sumconfv413] 



//more impact in the post 2000 period
//For CPA
nlcom _b[ L.agg_imp_rate1]*60 + _b[ciri_wopol_yrbefter_rev] + _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*0 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m]*0 +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000] *1 +_b[L.sumconfv413]
nlcom _b[ L.agg_imp_rate1]*60 + _b[ciri_wopol_yrbefter_rev] + _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*0 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m]*0 +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000] *0 +_b[L.sumconfv413]

//impact for non-cpa
nlcom _b[ L.agg_imp_rate1]*0 + _b[ciri_wopol_yrbefter_rev] + _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*1 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m] +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000]*1 +_b[L.sumconfv413]

//Non CPA is insignificant in the pre-2000 years
nlcom _b[ L.agg_imp_rate1]*0 + _b[ciri_wopol_yrbefter_rev]*0 + _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*1 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m] +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000]*0 +_b[L.sumconfv413]
nlcom _b[ L.agg_imp_rate1]*0 + _b[ciri_wopol_yrbefter_rev]*1 + _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*1 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m] +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000]*0 +_b[L.sumconfv413]

















margins, predict(outcome(0)) at(L.outcome_GovtVic ==1 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.agg_imp_rate1 ==0) atmeans



margins, predict(outcome(0)) at(L.inpam1 ==1) atmeans
margins, predict(outcome(1)) at(L.inpam1 ==1) atmeans
margins, predict(outcome(2)) at(L.inpam1 ==1) atmeans
margins, predict(outcome(3)) at(L.inpam1 ==1) atmeans

margins, predict(outcome(0)) at(L.outcome_RebelVic ==1) atmeans
margins, predict(outcome(1)) at(L.outcome_RebelVic ==1) atmeans
margins, predict(outcome(2)) at(L.outcome_RebelVic ==1) atmeans
margins, predict(outcome(3)) at(L.outcome_RebelVic ==1) atmeans

margins, predict(outcome(0)) at(L.outcome_GovtVic ==1) atmeans
margins, predict(outcome(1)) at(L.outcome_GovtVic ==1) atmeans
margins, predict(outcome(2)) at(L.outcome_GovtVic ==1) atmeans
margins, predict(outcome(3)) at(L.outcome_GovtVic ==1) atmeans

margins, predict(outcome(0)) at(L.nonCPA_PA ==1) atmeans
margins, predict(outcome(1)) at(L.nonCPA_PA ==1) atmeans
margins, predict(outcome(2)) at(L.nonCPA_PA ==1) atmeans
margins, predict(outcome(3)) at(L.nonCPA_PA ==1) atmeans


margins, predict(outcome(0)) at(L.outcome_GovtVic ==1 L.nonCPA_PA ==0 L.outcome_RebelVic ==0 L.inpam1 ==0) atmeans





margins, predict(outcome(1)) at(L.agg_imp_rate1 =(0(10)100)) atmeans



















//VDEM



 
  
  
  
  
  
//Table 1
sum ciri_wopol  coldcase outcome_RebelVic outcome_GovtVic  inpam agg_imp_rate1  nonCPA_PA cum_peace_year   wdi_gdpgr govonlyv413m ln_total_dead ln_wardur lnpkoave_total  wdi_natrr ex_constrain5_7 women_imp post_2000 sumconfv413 if year>1988 & year<2012 & mj_conflictid!=. 
sum ciri_wopol  coldcase outcome_RebelVic outcome_GovtVic  inpam agg_imp_rate1  nonCPA_PA cum_peace_year   wdi_gdpgr govonlyv413m ln_total_dead ln_wardur lnpkoave_total  wdi_natrr ex_constrain5_7 women_imp post_2000 sumconfv413 if year>1988 & year<2012 & mj_conflictid!=.&cum_peace_year==1 

//Table 2
//pam as dummy
xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year  if year>1988 & mj_conflictid!=. , vce(robust)
xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year  if year>1988 & mj_conflictid!=. , vce(robust)
xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur if year>1988 & mj_conflictid!=. &sample==1  ,vce(robust)
xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.lnpkoave_total  if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.lnpkoave_total  L.ex_constrain5_7  if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)




//Robustness tests
//V-DEM
xtreg v2x_gender vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 , fe vce(robust)
xtreg v2x_gender vdem_womemp_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 , fe vce(robust)






xtgee ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1, family(gaussian) corr(ar1)vce(robust)

//Marginsplot based on Model 7
//margins, predict(outcome(0)) at(L.agg_imp_rate1 ==(0(10)100)) atmeans
//quietly marginsplot 
//graph save Graph "C:\Users\Madhav Joshi\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\graph0.gph", replace

//margins, predict(outcome(1)) at(L.agg_imp_rate1 =(0(10)100)) atmeans
//quietly marginsplot 

//graph save Graph "C:\Users\Madhav Joshi\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\graph1.gph", replace


//margins, predict(outcome(2)) at(L.agg_imp_rate1 ==(0(10)100)) atmeans
//quietly marginsplot 
//graph save Graph "C:\Users\Madhav Joshi\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\graph2.gph", replace


//margins, predict(outcome(3)) at(L.agg_imp_rate1 ==(0(10)100)) atmeans
//quietly marginsplot 

//graph save Graph "C:\Users\Madhav Joshi\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\graph3.gph", replace

//graph combine "C:\Users\Madhav Joshi\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\graph0.gph" ///
//"C:\Users\Madhav Joshi\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\graph1.gph" ///
//"C:\Users\Madhav Joshi\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\graph2.gph" ///
//"C:\Users\Madhav Joshi\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\graph3.gph"

//graph combine "C:\Users\mjoshi2\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\Graph0-f.gph" "C:\Users\mjoshi2\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\Graph1-f.gph" "C:\Users\mjoshi2\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\Graph2-f.gph" "C:\Users\mjoshi2\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\Graph3-f.gph", ycommon

//Analysis 
xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

xtologit ciri_wopol ciri_wopol_yrbefter_rev L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

nlcom _b[ L.agg_imp_rate1]*60 +  _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*0 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m] +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000] +_b[L.sumconfv413] 

//more impact in the post 2000 period
//For CPA
nlcom _b[ L.agg_imp_rate1]*60 +  _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*0 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m] +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000] *1 +_b[L.sumconfv413]
nlcom _b[ L.agg_imp_rate1]*60 +  _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*0 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m] +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000] *0 +_b[L.sumconfv413]
//impact for non-cpa
nlcom _b[ L.agg_imp_rate1]*0 +  _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*1 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m] +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000]*1 +_b[L.sumconfv413]

//Non CPA is insignificant in the pre-2000 years
nlcom _b[ L.agg_imp_rate1]*0 +  _b[L.outcome_RebelVic]*0 + _b[L.outcome_GovtVic]*0  + _b[L.nonCPA_PA]*1 + _b[cum_peace_year] +_b[L.women_imp] +_b[L.govonlyv413m] +_b[L.ln_total_dead ] +_b[L.ln_wardur ] +_b[L.ex_constrain5_7] +_b[L.lnpkoave_total] + _b[L.wdi_natrr] +_b[L.wdi_gdpgr] +_b[L.post_2000]*0 +_b[L.sumconfv413]



//Table 4 switching the reference category/Lagged Dependent Variable

//switch the ref category to gov victory
xtologit ciri_wopol L.outcome_RebelVic L.coldcase L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol L.outcome_GovtVic L.coldcase L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wopol L.outcome_GovtVic L.outcome_RebelVic L.coldcase L.agg_imp_rate1  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

//lagged dependent variable
xtologit ciri_wopol L.ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)


////Appendix A - OLS Panel Model with fixed effect
//Table 2
//pam as dummy
xtreg ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year  if year>1988 & mj_conflictid!=. , fe vce(robust)
xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year  if year>1988 & mj_conflictid!=. , fe vce(robust)
xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur if year>1988 & mj_conflictid!=. &sample==1  , fe vce(robust)
xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.lnpkoave_total  if year>1988 & mj_conflictid!=. &sample==1 ,fe vce(robust)
xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.lnpkoave_total  L.ex_constrain5_7  if year>1988 & mj_conflictid!=. &sample==1 ,fe vce(robust)
xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr if year>1988 & mj_conflictid!=. &sample==1 , fe vce(robust)
xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1 ,fe vce(robust)
xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,fe vce(robust)



 //Appendix B - Robustness tests with VDEM data on women's empowerment
 //Gov victory is significant and positive compared to cold case
xtreg v2x_gender_codelow L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 , fe vce(robust)
//Compared to gov victory CPA is still positive and significant
xtreg v2x_gender_codelow L.outcome_RebelVic L.coldcase L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 , fe vce(robust)


//Appendix C -  linear prediction figure
//margins, at( L.agg_imp_rate1==(0(5)100)) atmeans
//marginsplot


//Appendix D Women's economic rights
 xtologit ciri_wecon L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

log close


//ESTOUT for Table 3
//Table 2
//pam as dummy
eststo: quietly xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year  if year>1988 & mj_conflictid!=. , vce(robust)
eststo: quietly xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year  if year>1988 & mj_conflictid!=. , vce(robust)
eststo: quietly xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur if year>1988 & mj_conflictid!=. &sample==1  ,vce(robust)
eststo: quietly xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.lnpkoave_total  if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.lnpkoave_total  L.ex_constrain5_7  if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly xtologit ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

eststo: quietly
esttab using "C:\Users\mjoshi2\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\Table2-final.rtf", b(a3) nogaps title (Table2: Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear

//Table 4
//switch the ref category to gov victory
eststo: quietly  xtologit ciri_wopol L.outcome_RebelVic L.coldcase L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly  xtologit ciri_wopol L.outcome_GovtVic L.coldcase L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
eststo: quietly  xtologit ciri_wopol L.outcome_GovtVic L.outcome_RebelVic L.coldcase L.agg_imp_rate1  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

//lagged dependent variable
eststo: quietly  xtologit ciri_wopol L.ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)

esttab using "C:\Users\mjoshi2\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\Table3-final.rtf", b(a3) nogaps title (Table2: Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear



//Appendix of linera models

eststo: quietly xtreg ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.inpam1 L.nonCPA_PA  cum_peace_year  if year>1988 & mj_conflictid!=. , fe vce(robust)
eststo: quietly xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year  if year>1988 & mj_conflictid!=. , fe vce(robust)
eststo: quietly xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur if year>1988 & mj_conflictid!=. &sample==1  , fe vce(robust)
eststo: quietly xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.lnpkoave_total  if year>1988 & mj_conflictid!=. &sample==1 ,fe vce(robust)
eststo: quietly xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.lnpkoave_total  L.ex_constrain5_7  if year>1988 & mj_conflictid!=. &sample==1 ,fe vce(robust)
eststo: quietly xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr if year>1988 & mj_conflictid!=. &sample==1 , fe vce(robust)
eststo: quietly xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 if year>1988 & mj_conflictid!=. &sample==1 ,fe vce(robust)
eststo: quietly xtreg  ciri_wopol L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,fe vce(robust)

esttab using "C:\Users\mjoshi2\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\appendix-A-final.rtf", b(a3) nogaps title (Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear

//Appendix B
 //Gov victory is significant and positive compared to cold case
eststo: quietly xtreg v2x_gender_codelow L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 , fe vce(robust)
//Compared to gov victory CPA is still positive and significant
eststo: quietly xtreg v2x_gender_codelow L.outcome_RebelVic L.coldcase L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 , fe vce(robust)
esttab using "C:\Users\mjoshi2\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\appendix-b-final.rtf", b(a3) nogaps title (Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear

//Appendix D
eststo: quietly  xtologit ciri_wecon L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
esttab using "C:\Users\mjoshi2\Box\2019-MJ-Home-Work\War Termination and Gender Rights\Final Data & Do files\appendix_d.rtf", b(a3) nogaps title (Conflict Termination and Women's Political Rights) cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear

log close
xtologit ciri_wecon ciri_weco_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)
xtologit ciri_wosoc ciri_wsoc_yrbefter L.outcome_RebelVic L.outcome_GovtVic L.agg_imp_rate1 L.nonCPA_PA  cum_peace_year L.women_imp L.govonlyv413m L.ln_total_dead L.ln_wardur L.ex_constrain5_7 L.lnpkoave_total  L.wdi_natrr L.wdi_gdpgr L.post_2000 L.sumconfv413 if year>1988 & mj_conflictid!=. &sample==1 ,vce(robust)


graph hbar, ///
over(sat, label(labsize(small)))

